package com.itcv.mybatis.demo.dynamic.proxy;

import com.itcv.mybatis.demo.reflect.HelloMapper;

import java.lang.reflect.Proxy;

public class DynamicProxyTest {

    public static void main(String[] args) {
       HelloMapper helloMapper = (HelloMapper) Proxy.newProxyInstance(HelloMapper.class.getClassLoader(),new Class[]{HelloMapper.class},new DynamicProxy(new HelloMapperImpl()));
       String h = helloMapper.say("李明");
        System.out.println("h = " + h);
    }
}
